//
//  UiUtil.h
//  Amily
//
//  Created by "" on 15/1/7.
//  Copyright (c) 2015年 Amily. All rights reserved.
//

#import <Foundation/Foundation.h>
//#import "UIFont+FZLanTing.h"
#define cell_label_text_color @"#1e1e1e"

#define DEFAULTTEXTFONT 16
#define DEFAULTTABLECELLHEIGHT 44
#define IPhone6PCellWidth 414
#define IPhone6CellWidth 375
#define IPhone5CellWidth 320
#define RateForm6P ([[UIScreen mainScreen] bounds].size.width /IPhone6PCellWidth)

#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
#define ALCOLOR(colorName) [UiUtil parseColorFromValues:colorName]


#define ALScreenSizeOri(ori)    [UiUtil screenSizeOri:ori]
#define ALScreenHeightCurOri    [UiUtil screenHeightCurOri] //当前转向的高度
#define ALScreenWidthCurOri     [UiUtil screenWidthCurOri]  //当前转向的宽度
#define ALStatusBarHeight       [UiUtil statusBarHeight]
#define ALNavigationBarHeightCurOri     [UiUtil navigationBarHeightCurOri]
#define ALTabBarHeight [UiUtil tabBarHeight]
#define ALMainHeightCurOri      (ALScreenHeightCurOri - ALStatusBarHeight)
#define ALMainWidthCurOri       ALScreenWidthCurOri
#define ALIphoneWidth   [[UIScreen mainScreen] bounds].size.width
#define ALIphoneHeight  [[UIScreen mainScreen] bounds].size.height



@interface UiUtil : NSObject
+(CGFloat) statusBarHeight;
+(CGFloat) navigationBarHeightCurOri;
+(CGFloat) screenHeightCurOri;
+(CGFloat) screenWidthCurOri;
+(CGSize) screenSizeOri:(UIInterfaceOrientation)orientation;
+ (CGFloat)tabBarHeight;
//+(CGFloat) visibleHeight:(ALBaseViewController *)controller;
+(NSUInteger) labelNumberOfLines:(NSString *)text maxWidth:(NSInteger)maxWidth font:(UIFont*)font;
// maxHeight限制高度
+(NSUInteger) labelNumberOfLines:(NSString *)text maxWidth:(NSInteger)maxWidth maxHeight:(NSInteger)maxHeight font:(UIFont*)font;
+(CGFloat) labelLineHeight:(UIFont*)font;
+(CGSize) labelSizeOfLabel:(UILabel*)label;
+(CGSize) labelSizeOfLabel:(UILabel*)label maxWidth:(NSInteger)maxWidth;
+(CGFloat) labelWidth:(NSString *)text  maxWidth:(NSInteger)maxWidth  font:(UIFont*)font;
+(CGFloat) labelWidth:(NSString*)text font:(UIFont*)font;
+(CGFloat) labelHeight:(UILabel *)label;
+(CGFloat) labelHeight:(NSString *) text maxWidth:(NSInteger)maxWidth font:(UIFont*)font;
// maxHeight限制高度
+(CGFloat) labelHeight:(NSString *) text maxWidth:(NSInteger)maxWidth maxHeight:(NSInteger)maxHeight font:(UIFont*)font;
+(CGFloat) labelWordBreakWidth:(NSString *)text  maxWidth:(NSInteger)maxWidth font:(UIFont*)font;
+(CGFloat) labelWordBreakHeight:(NSString *)text  maxWidth:(NSInteger)maxWidth  font:(UIFont*)font;
+(NSUInteger) labelWordBreakNumberOfLines:(NSString *)text maxWidth:(NSInteger)maxWidth font:(UIFont*)font;
// 计算最小fit的rect，位置大小不变。
+(CGRect) autoFitRectForLable:(UILabel*)lable;
+(CGRect) autoFitRectForLableAllowMultipleLines:(UILabel*)lable;
+(UIColor*) parseColorFromValues:(NSString*)cssString;
+ (BOOL) validateUserPhone:(NSString *)str;
+ (BOOL) validateUserEmail:(NSString *)str;
+ (void)setStatusBarHidden:(BOOL)bHidden withAnimation:(UIStatusBarAnimation)aAnimation;
+ (BOOL)isStatusBarHidden;

@end
